home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Graphics / sKulpt / skulpt-src / Ami-Asl.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-26  |  1.8 KB  |  94 lines

  1. #define STRICT
  2.  
  3. // Includes standard Windows
  4. #include <windows.h>
  5. #include <windowsx.h>
  6. #include <time.h>
  7. #include <stdlib.h>
  8. #include <malloc.h>
  9. #include <memory.h>
  10. #include <stdio.h>
  11.  
  12. // Includes D3D
  13. #define  D3D_OVERLOADS
  14. #include <ddraw.h>
  15. #include <d3d.h>
  16. #include <d3dx.h>
  17.  
  18. // Includes utilitaires D3D
  19. #include "d3dmath.h"
  20. #include "d3dutil.h"
  21. #include "D3DEnum.h"
  22.  
  23. // Ids Resources
  24. #include "resource.h"
  25.  
  26. // Constantes
  27. #include "const.h"
  28.  
  29. // Types
  30. #include "types.h"
  31.  
  32. // Variables globales projet
  33. #include "vars.h"
  34.  
  35. // Prototypes fonctions autres modules
  36. #include "proto.h"
  37.  
  38. // Macros
  39. #include "macros.h"
  40.  
  41. static struct FileRequester *hFileRequester = (struct FileRequester *) NULL;
  42.  
  43. int FSInit(void)
  44. {
  45.     struct TagItem sTagList[] =
  46.     {
  47.         { ASLFR_Screen,         (ULONG) hInst},
  48.         { ASLFR_SleepWindow,    TRUE},
  49.         { ASLFR_TitleText,      (ULONG) "Choisissez un fichier ..."},
  50.         { ASLFR_DoPatterns,     TRUE},
  51.         { ASLFR_RejectIcons,    TRUE},
  52.         { TAG_DONE,             TAG_DONE}
  53.     };
  54.  
  55.     return (int) (hFileRequester = (struct FileRequester *) AllocAslRequest(ASL_FileRequest, sTagList));
  56. }
  57.  
  58. int FSelect(char *Bouton, char *Fichier)
  59. {
  60.    int FResult = 0;
  61.    struct TagItem sTagList[] =
  62.    {
  63.        { ASLFR_InitialPattern, (ULONG) Fichier},
  64.           { TAG_DONE,             TAG_DONE}
  65.    };
  66.  
  67.    if (hFileRequester)
  68.    {
  69.        if (FResult = AslRequest(hFileRequester, sTagList))
  70.        {
  71.          strcpy(Fichier, hFileRequester->fr_Drawer);
  72.  
  73.          if (strlen(Fichier))
  74.                if ((Fichier[strlen(Fichier) - 1] != '/')
  75.                 && (Fichier[strlen(Fichier) - 1] != ':'))
  76.                   strcat(Fichier, "/");
  77.  
  78.          strcat(Fichier, hFileRequester->fr_File);
  79.        }
  80.    }
  81.  
  82.    return(FResult);
  83. }
  84.  
  85. void FSClose(void)
  86. {
  87.     if (hFileRequester)
  88.     {
  89.         FreeAslRequest(hFileRequester);
  90.         hFileRequester = NULL;
  91.     }
  92. }
  93.  
  94.